/**
 * 2325. 解密消息
 * @param {string} key
 * @param {string} message
 * @return {string}
 */
var decodeMessage = function (key, message) {
	const map = new Map()
	let cur = 'a'
	for (let i = 0; i < key.length; i++) {
		if (map.size === 26) break
		const c = key[i]
		if (c !== ' ' && !map.has(c)) {
			map.set(c, cur)
			cur = String.fromCharCode(cur.charCodeAt() + 1)
		}
	}
	let ret = ''
	for (let i = 0; i < message.length; i++) {
		let c = message[i]
		if (c !== ' ') {
			c = map.get(c)
		}
		ret += c
	}
	return ret
}
const ret = decodeMessage(
	'eljuxhpwnyrdgtqkviszcfmabo',
	'zwx hnfx lqantp mnoeius ycgk vcnjrdb'
)

console.log('decodeMessage :>>', ret)
